package de.hauschild.gmltracer.gml.impl.value.real;

public class ClampfRealOperatorToken extends OneRealOperatorToken {

  @Override
  public String toString() {
    return "clampf";
  }

  @Override
  protected Double compute(final Double value) {
    if (value < 0.0) {
      return 0.0;
    } else if (value > 1.0) {
      return 1.0;
    } else {
      return value;
    }
  }
}
